package cn.wsalix.templet.type;

/**
 * 请求参数条件 1,单篇文章ID 2,多篇文章分类ID 3,单个菜单ID 4,多个菜单父ID 5，单个分类 6，分类父id 5,单个广告
 * 6，广告图文组父ID 选择Category时，保存分类Code
 */
public enum PlaceDataEnum {
	ARTICLE_ONE("0", "单篇文章"), ARTICLE_GROUP("1", "分类文章"), MENU_ONE("2", "单个菜单"), MENU_GROUP(
			"3", "分组菜单"), CAT_ONE("4", "单篇分类"), CAT_GROUP("5", "分组分类"), AD_ONE(
			"6", "单个广告");
	private String code;
	private String title;

	PlaceDataEnum(String code, String title) {
		this.code = code;
		this.title = title;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public static PlaceDataEnum findByCode(String code) {
		for (PlaceDataEnum userKind : PlaceDataEnum.values()) {
			if (userKind.getCode().equals(code)) {
				return userKind;
			}
		}
		return null;
	}

}
